type EventName<T extends string> = `${T}Change`;

type T1 = EventName<"foo">; // fooChange
type T2 = EventName<"foo" | "fun">; // fooChange  funChange

type Name = "Change";
type JoinString<T extends string> = `${Name}${T}`;
type T3 = JoinString<"Name">;

type SpaceType = " " | "\n" | "\t";
//                               判断 T 是不是 " XXXX" 类型，是的话 推断出 R就是 XXXX
type TrimLeft<T extends string> = T extends `${SpaceType}${infer R}`
  ? TrimLeft<R>
  : T;

type Trim1 = TrimLeft<"  1 ">;

// 把字符串类型拆分. 提取字符串中的第一个字符
type MyCapitalize<T extends string> = T extends `${infer R}${infer K}` ? R : T;
type M1 = MyCapitalize<"name">; // n
type M2 = Uppercase<"a">; // A 小写转大写

export {};
